package com.BraveY.Demo07;

import java.math.BigDecimal;
import java.util.Arrays;

public class Demo03 {
    public static void main(String[] args) {
        float num = -5.6F;

        float num1 = Math.abs(num);
        double num2 = Math.ceil(num1);
        double num3 = Math.floor(num1);
        int num4 = Math.max(8, 6);
        int num5 = Math.min(8, 6);
        int num6 = Math.round(num1);
        System.out.println(num1);
        System.out.println(num2);
        System.out.println(num3);
        System.out.println(num4);
        System.out.println(num5);
        System.out.println(num6);
        int sum = 0;
        long start = System.currentTimeMillis();
        for (int i = 0; i < 1000; i++) {
            sum += i;
        }
        long end = System.currentTimeMillis();

        long timer = end - start;
        System.out.println("时间：" + timer + "--" + sum);

        BigDecimal num8 = new BigDecimal("888");
        BigDecimal num9 = new BigDecimal("999");
        BigDecimal res1 = num8.add(num9);
        BigDecimal res2 = num8.subtract(num9);
        BigDecimal res3 = num8.multiply(num9);
//        BigDecimal res4 = num8.divide(num9);
//        BigDecimal res5 = num8.divide(num9,8);
        System.out.println(res1);
        System.out.println(res2);
        System.out.println(res3);
//        System.out.println(res4);
//        System.out.println(res5);


        int [] arr = {1,2,3,4,5,6,7,8,9,10};
        int index = Arrays.binarySearch(arr, 0);
        System.out.println(index);

    }
}
